package com.liehacker.android.etcs;

import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.VideoView;

import com.liehacker.android.R;
import com.liehacker.android.ontop.LiehackerSuperActivity;

public class ActivityControlActivity extends LiehackerSuperActivity{

	VideoView mVideoView;
	MediaPlayer mMediaPlayer;
	String urlVideo;
	
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);		
		
		setContentView(R.layout.c03_videoview);
		
		mVideoView = (VideoView)findViewById(R.id.videoViewRtsp);
		
		
		Button btnOri = (Button)findViewById(R.id.button1);
		btnOri.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				urlVideo = "http://url.cds.tving.com/dynamic/00114535.DM4.40.mp4?SIGV=3&IS=0&CIP=52.32.214.48&ET=1311958585&KO=27&KN=14&US=DSA=r:714928060b531df71d4edc5a31f11c7f0aada45a34ec7240:s:ba888cd8180c0cb3c1d034667f8d7b9f62dc76382c4e4416";
				mVideoView.setVideoURI(Uri.parse(urlVideo));
				mVideoView.start();
				
				showToast(urlVideo);
			}
			
		});
		
		Button btnModify = (Button)findViewById(R.id.button2);
		btnModify.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub 
				urlVideo = "http://url.cds.tving.com/dynamic/00114535.DM4.40.mp4?SIGV=3&IS=0&CIP=52.32.214.48&ET=1311958585&KO=27&KN=14&US=DSA=r%3A714928060b531df71d4edc5a31f11c7f0aada45a34ec7240%3As%3Aba888cd8180c0cb3c1d034667f8d7b9f62dc76382c4e4416";
				mVideoView.setVideoURI(Uri.parse(urlVideo));
				mVideoView.start();
			}
		
		});
		
	}
	
}
